/* 节流 (throttle) */
function throttle(fn, wait) {
  let timeout;
  return (...params) => {
    if (!timeout) {
      timeout = setTimeout(() => {
        fn(...params);
        timeout = null;
      }, wait);
    }
  };
}

export default throttle;
